package cn.xiaolang.function.design_pattern.strategyAdapter;

/**
 * 支付方式的枚举
 *
 * @author fuhw/Dean
 * @date 2016年9月5日
 */
public enum PayTypeEnum {

    PAY_BANK(1, "网银"),

    PAY_ALI_PAY(2, "支付宝"),

    PAY_WEB_CHAT(3, "微信");


    private int value;


    private String description;


    private PayTypeEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int value() {
        return value;
    }

    public String description() {
        return description;
    }


    public static PayTypeEnum valueOf(int value) {
        for (PayTypeEnum type : PayTypeEnum.values()) {
            if (type.value() == value) {
                return type;
            }
        }
        return null;
    }
}